<template>
  <div class="index column">
    <IndexHeader></IndexHeader>
    <div class="index-main column">
      <IndexFloor :newsList="this.newsList"></IndexFloor>
      <LoginBtns></LoginBtns>
      <IndexList
        :compList="this.compList"
        :noticesList="this.noticesList"
        :downloadsList="this.downloadsList"
      ></IndexList>
    </div>
    <BottomBar></BottomBar>
  </div>
</template>

<script>
import articalApi from "@/api/artical";
import IndexHeader from "@/components/IndexHeader";
import IndexFloor from "@/components/index/indexFloor";
import LoginBtns from "@/components/index/loginBtns";
import IndexList from "@/components/index/indexList";
import BottomBar from "@/components/BottomBar";
export default {
  name: "index",
  components: {
    IndexHeader,
    IndexFloor,
    LoginBtns,
    IndexList,
    BottomBar,
  },
  mounted() {
    this.getArticalList();
  },
  data() {
    return {
      newsList: null,
      noticesList: null,
      downloadsList: null,
      compList: null,
    };
  },
  methods: {
    getArticalList() {
      var formData = new FormData();
      articalApi.getListByType(formData).then((res) => {
        var data = res.data.data;
        console.log("getListByType", data);
        this.newsList = data.newsList;
        this.noticesList = data.noticesList;
        this.downloadsList = data.downloadsList;
        this.compList = data.compList;
        // console.log(this.newsList,this.noticesList,this.downloadsList);
      });
    },
  },
};
</script>

<style scoped>
.index {
  min-height: 100%;
}
.index-main {
  margin: 14px 400px 14px;
  padding: 14px;
  box-shadow: 0px 0px 10px #f4f4f4;
}
</style>